package com.hr.builder;

import org.springframework.stereotype.Component;

import com.espirit.eap.manager.ModelBuilderSupport;
import com.hr.SchedualRecord;

@Component
public class SchedualRecordBuilder extends ModelBuilderSupport {
	static final String EMPLOYEE = "employee";
	static final String PARENT = "parent";
	
	
	@Override
	public boolean init() {
		return super.setClass(SchedualRecord.class, "Schedual Item", "排班明细");
	}	

	@Override
	public void buildFields() {
		super.buildFields();
		addModelField(EMPLOYEE, "Employee", "职员");
		addModelField(PARENT, "Schedual", "排班");
	}
	
	@Override
	protected void setDefaultLayoutButtons() {
		super.setDefaultLayoutButtons();
	}
	
	@Override
	protected void addSearchFields() {
		super.addSearchField(convertPropertyToField(EMPLOYEE, PARENT));
	}
	
	@Override
	protected void addListFields() {
		addListField(convertPropertyToField(EMPLOYEE, PARENT));
	}
	
	@Override
	protected void addDetailFields() {
		addDetailField(convertPropertyToField(EMPLOYEE, PARENT));
	}
	
	
	@Override
	protected void gatherExproperties() {
		exProperties.put(REQUIRED, new String[]{PARENT});
	}
}
